<div class="sidebar-menu flex-fill">
    <div class="sidebar-scroll">
        <div class="sidebar-menu-inner">
            {{ with $.Site.Data.navsites }}
            <ul>
                {{ range $index, $_ := . }}
                {{ if and .list (gt (len .list) 0) }}
                {{ $hash_str := printf "%v-main-%v" $index .taxonomy | md5 }}

                <li class="sidebar-item">
                    <a href="#category-{{ $hash_str }}" class="smooth">
                        {{ with .icon }}
                            <i class="{{ . }} icon-fw icon-lg mr-2"></i>
                        {{ end }}

                        <span>{{ .taxonomy }}</span>
                        <i class="fas fa-angle-right sidebar-more text-sm"></i>
                    </a>
                    
                    {{ with .list }}
                    {{ if gt (len .) 0 }}
                    <ul>

                        {{ range $idx, $_ := . }}
                        {{ $hash_str_sub := printf "%v-%v-child-%v" $index $idx .term | md5 }}
                        <li>
                            <a href="#category-{{ $hash_str_sub }}" class="smooth">
                                {{ with .icon }}
                                    <i class="{{ . }} icon-fw icon-lg mr-2"></i>
                                {{ end }}
                                
                                <span>{{ .term }}</span>
                            </a>
                        </li>
                        {{ end }}

                    </ul>
                    {{ end }}
                    {{ end }}

                </li>
                
                {{ end }}
                {{ end }}
            </ul>
            {{ end }}
        </div>
    </div>
</div>
